﻿using LprConfiger.Models;

namespace LprConfiger.Views
{
    using Catel.Windows;

    using ViewModels;

    /// <summary>
    /// Interaction logic for MainWindow.xaml.
    /// </summary>
    public partial class MainWindow : DataWindow<MainWindowViewModel>
    {
        private GeneralInfoPage _generalInfoPage;

        /// <summary>
        /// Initializes a new instance of the <see cref="MainWindow"/> class.
        /// </summary>
        public MainWindow()
            : base(DataWindowMode.Custom)
        {
            InitializeComponent();
        }

        private void GeneralInfoItem_Selected(object sender, System.Windows.RoutedEventArgs e)
        {
            if (_generalInfoPage == null)
            {
                _generalInfoPage = new GeneralInfoPage();
                _generalInfoPage.DataContext = this.DataContext;
            }
            mainViewContainer.Navigate(_generalInfoPage);
        }

        private void CamerasSettingsItem_Selected(object sender, System.Windows.RoutedEventArgs e)
        {
            if (e.OriginalSource == Camera1)
            {
                var page = new CamerasPage();
                mainViewContainer.Navigate(page);
            }
        }

        private void LaneItem_Selected(object sender, System.Windows.RoutedEventArgs e)
        {
            var page = new LanePage();
            mainViewContainer.Navigate(page);
        }

        private void TreeViewItem_MouseLeftButtonUp(object sender, System.Windows.Input.MouseButtonEventArgs e)
        {

        }

        private void LaneItem_MouseLeftButtonUp(object sender, System.Windows.Input.MouseButtonEventArgs e)
        {

        }
    }
}
